//类的声明
#include<bits/stdc++.h>
using namespace std;
class Student
{
private:
    int num;
    char name[20];
    char sex;
public:
    void set_data(int n,char *p,char s);

    void display();
};
void Student::set_data(int n,char *p,char s)
{
    num=n;
    strcpy(name,p);
    sex=s;
}
void Student::display()
{
    cout<<"num:"<<num<<endl;
    cout<<"name:"<<name<<endl;
    cout<<"sex:"<<sex<<endl<<endl;
}
int  main(){
    Student stud1,stud2;
    stud1.set_data(1,(char*)"He",'f');
    stud2.set_data(2,(char*)"She",'m');
    stud1.display();
    stud2.display();
}